New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: gradually reduce null-check errors #3094
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
gastonfournier
force-pushed
the
strict-null-checks
branch
from
February 13, 2023 12:45
e627ae3
to
f68f90f
Compare
gastonfournier
changed the title
chore: try to reduce null-checks against main
chore: gradually reduce null-check errors
Feb 13, 2023
chriswk
reviewed
Feb 13, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea. I'm a +1 on this
chriswk
approved these changes
Feb 14, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding an approve as well
gastonfournier
commented
Feb 14, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About the changes
In order to move us towards enabling
strictNullChecks
we'd want to have a way of gradually enabling this without having to fix all errors at once, this will force us to start reducing the number of null check issues.This new workflow:
gradual-strict-null-checks.sh
(from the current branch) against each folder in parallel to count the number of errors ifstrictNullChecks
was enabledAs an example, a new issue was introduced in this PR (and then reverted), so we can test the build failure:
https://github.com/Unleash/unleash/actions/runs/4163632636/jobs/7204268519#step:5:10
Discussion points
This could be a non-mandatory check, just advising, or even adding a comment in the PR. It might be good to start with a non-strict check, but at the same time we can decide to make it non-strict if a problem appears
In some situations, an additional null check error might require us to fix a bunch of them, increasing the time to deliver. In these cases we can suppress an individual line with
// @ts-ignore: Object is possibly 'null'.
although might defeat the purpose of this workflow